import React from 'react'
import cx from 'classnames'
import style from './style'
import icons from './icons/css/myfont';
import util from '../util'

export default ({ rotate, className, color, value, ...others }) => {
  let styles = {
    ...(others.style || {})
  }
	if (rotate) {
		styles.transform = `rotate(${rotate}deg)`
	}
	return (
		<i 
			style={{...util.attr(others), ...styles}}
			className={cx({
				[className]: !!className,
				[style.root]: true,
				[style[color]]: color,
				[icons['ic-' + value]]: true
			})} {...others}></i>
	)
}

